package com.atguigu.gulimall.gulimall.auth.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author phil
 * @create 2022-01-11 19:41
 */
@Configuration
public class GulimallWebConfig implements WebMvcConfigurer {

    /**
     * 发送一个请求直接跳转到一个页面。SpringMVC ViewControllers：将请求和页面映射过来
     * @param registry
     */
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/login.html").setViewName("login");
        registry.addViewController("/reg.html").setViewName("reg");
    }
}
